home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98c.txt
/
000036_icon-group-sender _Wed Sep 16 16:47:34 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
3KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id QAA10682
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Wed, 16 Sep 1998 16:47:33 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA04920; Wed, 16 Sep 1998 16:47:05 -0700
Date: Wed, 16 Sep 1998 18:11:17 -0400 (EDT)
From: cwills@bix.com
Subject: RE: Context Switching
To: icon-group@optima.CS.Arizona.EDU
Message-Id: <9809161811.memo.79389@BIX.com>
X-Cosy-To: icon-group@optima.CS.Arizona.EDU
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
I think that the crux of the issue is that the current (and as far as I
know only) implementation of Icon is what we currently have to work with.
As such... the current implementation uses C as the underlying language
in which the Icon runtime libraries are written in. Most of Icon actually
runs within the runtime library itself, alot of data is saved on the
C stack within many of the builtin functions that are generators (ie: find,
upto, etc.) The way that these builtin generators are written is to
re-invoke the interpreter recursively (adding another layer on to the
C stack). So... within the current implementation of the Icon VM,
the easiest and most efficient method to perform a co-expression switch
is to perform a full context-switch by flipping the C runtime stack.
Is this a *bad* thing to do.... not really... it turns out the this is
a fairly efficient method of performing the stack switch. I've implemented
the co-switch routine in two different architectures, and 4 different
compilers, and I never had that much problem with co-switch (in fact I
believe that the SAS C now has as part of its distributed runtime
library for the IBM Mainframe C, a set of co-routine functions that
perform the exact same context switch that happens with co-switch.
One must also remember that you are talking about the Icon Virtual Machine
implementation itself. If one steps back and takes a look at the
I-Code instructions (the same thing as the "java byte code"), the details
of context switching is left to the I-VM. I also suspect that if one
digs deep enough into the Java VM implementations, one will find all sort
of mean nasty and ugly things to tweak out that last bit of performance.
If one where to redesign and reimplement the I-VM, (such as in JCON) then
different facilities could be used.
Cheyenne
PS....
If you think that rswitch.asm is bad... just be glad that the good folks
at the Icon Project re-wrote the interpreter around version 5.10, 6,
or somewhere... in that implementation the Icon stack frame was inter-mixed
with the C stack frame, the interperter loop was written in assembler,
garbage collection routines knew how to traverse around the C stack
frames and find the Icon stack frame portions.